<!--
*
*  INSPINIA - Responsive Admin Theme
*  version 2.7
*
-->

<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <title><?=$system['sys_title']?> | <?=$title;?></title>
    <?php $this->load->view('template/css');?>
    <link rel="stylesheet" href="<?=base_url("assets/css/my.css")?>">
    <link rel="stylesheet" href="<?=base_url("assets/css/plugins/clockpicker/clockpicker.css")?>">
</head>

<body class="font16">
<?php $this->load->view('template/header');?>

<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5 style="font-size: 18px;"><?=$title;?></h5>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-sm-12">
                            <form method="post"class="form-horizontal" action="<?=site_url('main/add_system')?>" enctype="multipart/form-data" >
                                <input type="hidden" name="sys_id" value="<?=$system['sys_id']?>">
                                <div class="form-group"><label class="col-sm-2 control-label">网站标题</label>
                                    <div class="col-sm-9"><input type="text"  class="form-control"  name="sys_title" value="<?=$system['sys_title']?>"></div>
                                </div>
                                <div class="form-group"><label class="col-sm-2 control-label">网站名称</label>
                                    <div class="col-sm-9"><input type="text"  class="form-control " name="sys_name" value="<?=$system['sys_name']?>" ></div>
                                </div>
                                <div class="form-group"><label class="col-sm-2 control-label">联系电话</label>
                                    <div class="col-sm-9"><input type="number"class="form-control" name="sys_phone" value="<?=$system['sys_phone']?>" ></div>
                                </div>
                                <div class="form-group"><label class="col-sm-2 control-label">打卡时间</label>
                                    <div style="float:left;padding-left: 15px;width:37%"; class=" input-group clockpicker" data-autoclose="true">
                                         <span class="input-group-addon">
                                            <span class="fa fa-clock-o"></span>开始时间
                                        </span>
                                        <input type="text" class="form-control" name="sys_start_time"  readonly value="<?=$system['sys_start_time']?$system['sys_start_time']:'05:00'?>" >
                                    </div>
                                    <div style="float:left;width:37%" class="input-group clockpicker" data-autoclose="true">
                                        <span class="input-group-addon">
                                            <span class="fa fa-clock-o"></span>结束时间
                                        </span>
                                        <input type="text" class="form-control" name="sys_over_time" readonly value="<?=$system['sys_over_time']?$system['sys_over_time']:'08:00'?>" >

                                    </div>
                                </div>
                                <div class="form-group"><label class="col-sm-2 control-label">微信手续费（千分比）</label>
                                    <div class="col-sm-9"><input type="text" required pattern="\d(.\d{2})?" class="form-control" name="sys_percent" value="<?=$system['sys_percent']?>" ></div>
                                </div>
                                <div class="form-group"><label class="col-sm-2 control-label">扣留金额（千分比）</label>
                                    <div class="col-sm-9"><input type="text" required pattern="\d(.\d{2})?" class="form-control" name="sys_wx_percent" value="<?=$system['sys_wx_percent']?>" ></div>
                                </div>
                                <div class="form-group"><label class="col-sm-2 control-label">网站log</label>
                                    <div class="col-sm-9">
                                        <img id="upload_img" src="<?=base_url('uploads/template/'.$system['sys_logo'])?>" width="180px" alt="log">
                                        <input type="file"  id="form-file" name="file">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-sm-4 col-sm-offset-2">
                                        <button class="btn btn-primary" type="submit" >修改配置</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


<script>
    var SCOPE={
        'url_form':'<?=site_url('manage/admin/add_admin')?>',
        'url_del':'<?=site_url('manage/admin/del_admin')?>',
        'url_ajax':'<?=site_url('manage/admin/get_by_admin')?>',
        'url_edit':'<?=site_url('manage/admin/edit_admin')?>',
        'url_status':'<?=site_url('manage/admin/change_status_admin')?>'
    }
</script>
<?php $this->load->view('template/foot');?>
<?php $this->load->view('template/scrip');?>
<!-- Jquery Validate -->
<script src="<?=base_url("assets/js/Validform_v5.3.2_min.js")?>"></script>
<script src="<?=base_url("assets/js/dialog.js")?>"></script>
<script src="<?=base_url("assets/js/plugins/clockpicker/clockpicker.js")?>"></script>

    <script>
        $('form').submit(function(){
            var sys_start_time = $(this).find('input[name=sys_start_time]').val().split(':');
            var sys_over_time = $(this).find('input[name=sys_over_time]').val().split(':');
            if(sys_start_time[0]>sys_over_time[0]){
                swal('开始时间必须小于结束时间，请重新选择！');
                return false;
            }
            if(sys_start_time[0]==sys_over_time[0] && sys_start_time[1]>sys_over_time[1]){
                swal('开始时间必须小于结束时间,请重新选择！');
                return false;
            }
        })
        $(document).ready(function() {
            $('.clockpicker').clockpicker();
        })
    </script>
</body>
</html>
